package com.atguigu.serviceedu.controller.frontController;

import com.atguigu.commonutils.R;
import com.atguigu.serviceedu.entity.EduCourse;
import com.atguigu.serviceedu.entity.EduTeacher;
import com.atguigu.serviceedu.entity.chaptervo.ChapterInfoVo;
import com.atguigu.serviceedu.entity.coursevo.CourseQueryVo;
import com.atguigu.serviceedu.entity.coursevo.CourseWebVo;
import com.atguigu.serviceedu.entity.subjectvo.OneSubjectVo;
import com.atguigu.serviceedu.service.EduChapterService;
import com.atguigu.serviceedu.service.EduCourseService;
import com.atguigu.serviceedu.service.EduSubjectService;
import com.atguigu.serviceedu.service.EduTeacherService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

//@CrossOrigin
@RestController
@Api(description = "显示首页内容")
@RequestMapping("edu/index")
public class IndexController {

    @Autowired
    EduTeacherService teacherService;
    @Autowired
    EduCourseService courseService;

    @GetMapping("getHotTeachers")
    public R getHotTeachers(){
        List<EduTeacher> hotTeachers = teacherService.getHotTeachers();
        return R.ok().data("hotTeachers",hotTeachers);
    }

    @GetMapping("getHotCourses")
    public R getHotCourses(){
        List<EduCourse> hotCourses = courseService.getHotCourses();
        return R.ok().data("hotCourses",hotCourses);
    }


}